package com.noassertions.domain;

import java.io.Serializable;
import java.sql.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;

//TODO: implement serializable
@Entity
public class Fit implements Serializable
{
	@Id
    @GeneratedValue
	private int fitid;
	private int riderid;
	private Date dateofmeasurement;
	@Column(nullable=true)
	private float saddleheight;
	@Column(nullable=true)
	private float centertobars;
	@Column(nullable=true)
	private float centertosaddle;
	@Column(nullable=true)
	private float floortobars;
	@Column(nullable=true)
	private float floortosaddle;
	private String notes; 
	@OneToMany (cascade = CascadeType.ALL) //, fetch=FetchType.EAGER)
	@JoinColumn(name = "fitid")
	private Set<Image> images = new HashSet();
	
	public int getFitid() {
		return fitid;
	}
	public void setFitid(int fitid) {
		this.fitid = fitid;
	}
	public int getRiderid() {
		return riderid;
	}
	public void setRiderid(int riderid) {
		this.riderid = riderid;
	}
	public Date getDateofmeasurement() {
		return dateofmeasurement;
	}
	public void setDateofmeasurement(Date dateofmeasurement) {
		this.dateofmeasurement = dateofmeasurement;
	}
	public float getSaddleheight() {
		return saddleheight;
	}
	public void setSaddleheight(float saddleheight) {
		this.saddleheight = saddleheight;
	}
	public float getCentertobars() {
		return centertobars;
	}
	public void setCentertobars(float centertobars) {
		this.centertobars = centertobars;
	}
	public float getCentertosaddle() {
		return centertosaddle;
	}
	public void setCentertosaddle(float centertosaddle) {
		this.centertosaddle = centertosaddle;
	}
	public float getFloortobars() {
		return floortobars;
	}
	public void setFloortobars(float floortobars) {
		this.floortobars = floortobars;
	}
	public float getFloortosaddle() {
		return floortosaddle;
	}
	public void setFloortosaddle(float floortosaddle) {
		this.floortosaddle = floortosaddle;
	}
	public Set<Image> getImages() {
		return images;
	}
	public void setImages(Set<Image> images) {
		this.images = images;
	}
	public void setNotes(String notes) {
		this.notes = notes;
	}
	public String getNotes() {
		return notes;
	}
}